﻿﻿// Copyright (c) Microsoft Corporation. All rights reserved. See License.txt in the project root for license information.

using System;
using System.Collections.Generic;
using Microsoft.ServiceBus.Messaging;

namespace Nardax.Azure.ServiceBus
{
    public interface ISubscriptionAdapter : ISubscriptionAdapter<BrokeredMessage>
    { }

    public interface ISubscriptionAdapter<T>
    {
        void Initialize();

        IEnumerable<T> GetConsumingEnumerable();

        IEnumerable<T> GetDeadLetterConsumingEnumerable();

        void StopReceiving();

        void Close();

        event EventHandler<ReceiveFailedEventArgs> ReceiveFailed;

        event EventHandler SubscriptionIsEmpty;

        event EventHandler DeadLetterQueueIsEmpty;

        SubscriptionAdapterDescription<T> SubscriptionAdapterDescription { get; }
    }
}